import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-11-25
 * Time:14:39
 */
class Solution {
    public int[] smallestK(int[] arr, int k) {
        PriorityQueue<Integer> p=new PriorityQueue<>();
        for(int i=0;i<arr.length;i++){
            p.offer(arr[i]);
        }
        int []ret=new int[k];
        for(int i=0;i<k;i++){
            ret[i]=p.poll();
        }
        return ret;
    }
}

public class Test {
    // 插入排序
    public static void insertSort(int[] array){
        // write code  here

    }
    // 希尔排序
    public static void shellSort(int[] array){
        // write code  here
    }
    public static void main(String args[]){
        Scanner scanner =new Scanner(System.in);
        String A=new String();
        String B=new String();
        while(scanner.hasNextLine()){

            A=scanner.nextLine();
            B=scanner.nextLine();
        }
        int sum=0;
        for(int i=0;i<=A.length();i++){
            StringBuffer str=insert(A,B,i);
            if(palindrome(str)){
                sum++;
            }
        }
        System.out.print(sum);
    }
    public static StringBuffer insert(String A, String B,int i){
        StringBuffer str=new StringBuffer();
        int j=0;
        while(j<i){
            str.append(A.charAt(j));
            j++;
        }
        for(int k=0;k<B.length();k++){
            str.append(B.charAt(k));
        }
        for(;j<A.length();j++){
            str.append(A.charAt(j));
        }
        return str;
    }
    public static boolean palindrome(StringBuffer str){
        int left=0;
        int right=str.length()-1;
        while(left<right){
            if(str.charAt(left)!=str.charAt(right)){
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
}
